<?php


namespace app\index\controller;


use think\Controller;

class Article extends Base
{
    public function index(){
        $article = model('article')->select();
        $Recommend = model('article')->order('create_time','desc')->limit(4)->select();
        $this->assign(compact('article','Recommend'));
        return view();
    }

    public function detail($id){
        $article = model('article')->find($id);
        $Recommend = model('article')->order('create_time','desc')->limit(4)->select();
        $this->assign(compact('article','Recommend'));
        return view();
    }

}
